HatchShape AddPolyline

Add an Polyline boundary to the HatchShape

Overloads

public void AddPolyline(IEnumerable<Point3D> vertices)
public void AddPolyline(PolylineShape polylineShape)

 

Return value

void  

 

Parameters

IEnumerable<Point3D> vertices list of vertices which describes the polyline
PolylineShape polylineShape A PolylineShape object

 

Example

Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);

if (scanDocument != null)
{
    VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);

    vectorImage.SetMarkSpeed(1000);
    vectorImage.SetJumpSpeed(2000);
    vectorImage.SetJumpDelay(100);
    vectorImage.SetMarkDelay(100);

    //Set Laser Delays
    vectorImage.SetLaserOnDelay(10);
    vectorImage.SetLaserOffDelay(10);

    IList<Point3D> pl1 = new List<Point3D>();
    pl1.Clear();
    pl1.Add(new Point3D(10, 10, 0));
    pl1.Add(new Point3D(0, 30, 0));
    pl1.Add(new Point3D(-10, 10, 0));
    pl1.Add(new Point3D(-30, 0, 0));
    pl1.Add(new Point3D(30, 0, 0));
    pl1.Add(new Point3D(10, 10, 0));

    HatchShape hatchShape = new HatchShape();
    hatchShape.AddPolygon(pl1);

    hatchShape.AddHatchPatternLine(0.5f, HatchLineBorderGapDirection.Inward, 0.1f,
                   0, 0, 0, HatchLineStyle.Unidirectional, false,
                   HatchOffsetAlgorithm.DirectOffset, HatchCornerStyle.Sharp);

    vectorImage.AddHatch(hatchShape,0);

    scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));

    try
    {
        scanDocument.StartScanning();
    }
    catch (Exception exp)
    {
        MessageBox.Show(exp.Message);
    }
}